import requests
from config import url, headers_web


class IndexDetail:
    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_indexDetailList(cls, url: str, headers=headers_web, params=None):
        """
        Summary:接口-评价指标内容列表
        Description:调用方：1.云课堂管理端-维护评价指标内容使用
        :param url:
        :param headers:
        :param params:
        :return:
        """
        url = url + "/teachingApi/api/v1/index/detail/list"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_addIndexDetail(cls, url: str, headers=headers_web, params=None, json=None):
        """
        Summary:接口-添加/修改评价指标内容
        Description:调用方：1.云课堂管理端-维护评价指标内容使用
        :param url:
        :param headers:
        :param params:
        :param json
        :return:
        """
        url = url + "/teachingApi/api/v1/index/detail"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_delIndexDetail(cls, url: str, headers=headers_web, params=None, json=None, paramspath=None):
        """
        Summary:接口-删除评价指标内容
        Description:调用方： 1.云课堂管理端
        :param url:
        :param headers:
        :param params:
        :param json
        :param paramspath
        :return:
        """
        url = url + f"/teachingApi/api/v1/index/detail/{paramspath}/del"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_importIndexDetail(cls, url: str, headers=headers_web, params=None, json=None):
        """
        Summary:接口-导入评价指标内容
        Description:调用方：1.云课堂管理端-维护评价指标内容使用
        :param url:
        :param headers:
        :param params:
        :param json
        :return:
        """
        url = url + "/teachingApi/api/v1/index/detail/import"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r
